import { FormConfig } from '@/components'
import { Row } from '@/components/FTable/components/search'
import { configCurryFilter } from '@/dictionaries/filter'
import { BaseDto, Status } from '@/interfaces'
import { isTrue } from '@/utils/tools'
import { UserState } from '@/views/user/list/uilts'
import dayjs from 'dayjs'
import { shallowRef } from 'vue'
/*
 * @Description:
 * @Author: fhw
 * @Date: 2023-02-23 14:41:28
 */
/** 情侣状态 */
export enum CoupleStatus {
	/** 邀请中 */
	PENDING = 'pending',
	/** 已确认关系 */
	CONFIRMED = 'confirmed',
	/** 分手 */
	BROKEN_UP = 'broken_up',
	/** 已拒绝 */
	REJECTED = 'REJECTED',
	/** 结婚 */
	MARRY = 'marry',
}
export interface CoupleState extends BaseDto {
	/** 男方（情侣中的一人） */
	male?: UserState
	/** 女方（情侣中的另一人） */
	female?: UserState
	/** 情侣状态 */
	status?: CoupleStatus
	/** 背景图片 */
	bgUrl?: string
	/** 关系建立时间 */
	relationshipDate?: Date
	/** 关系解除时间 */
	breakupDate?: Date
	/** 结婚时间 */
	weddingDate?: Date
	diariesCount?: number
	photoAlbumCount?: number
	/** 爱情宣言 */
	disjunction?: string
}
export const columns: F.TableColumns[] = [
	{
		title: 'id',
		key: 'id',
		dataIndex: 'id',
		align: 'center',
		width: 60
	},
	{
		title: '操作用户',
		key: 'userId',
		dataIndex: 'userId',
		align: 'center',
		width: 200
	},
	{
		title: '操作名称',
		key: 'name',
		dataIndex: 'name',
		align: 'center',
		width: 200
	},
	{
		title: '接口路径',
		key: 'interfacePath',
		dataIndex: 'interfacePath',
		align: 'center',
		width: 200
	},
	{
		title: '请求方式',
		key: 'method',
		dataIndex: 'method',
		align: 'center',
		width: 200
	},
	{
		title: '操作类型',
		key: 'operateType',
		dataIndex: 'operateType',
		align: 'center',
		width: 200
	},
	{
		title: '操作表',
		key: 'outside',
		dataIndex: 'outside',
		align: 'center',
		width: 200
	},
	{
		title: 'ip',
		key: 'ip',
		dataIndex: 'ip',
		align: 'center',
		width: 200
	},
	{
		title: '创建时间',
		key: 'createDate',
		dataIndex: 'createDate',
		align: 'center',
		width: 200,
		customRender: ({ record }: F.RableSlotScope<BaseDto>) =>
			record.createDate && dayjs(record.createDate).format('YYYY-MM-DD HH:mm:ss'),
	},
]
export const rows: Array<Row> = [
	{
		title: '操作名称',
		key: 'name',
		component: 'a-input',
	},
	{
		title: '接口路径',
		key: 'interfacePath',
		component: 'a-input',
	},
	{
		title: '操作名称',
		key: 'method',
		component: 'a-input',
	},
	{
		title: 'ip',
		key: 'ip',
		component: 'a-input',
	},
	{
		title: '操作类型',
		key: 'operateType',
		component: 'a-input',
	},
]